package com.zjp.mg.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Field;
import org.springframework.data.mongodb.core.mapping.FieldType;
import org.springframework.data.mongodb.core.mapping.MongoId;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
public class User implements Serializable {
    private static final long serialVersionUID = 1L;
    @MongoId(value = FieldType.INT64)
    @Field("_id")
    @Id
    private Long userId;
    private String username;
    private String school;
    private Integer age;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date time;
    private List<String> city;

    public User(String username, String school, Integer age, Date time) {
        this.username = username;
        this.school = school;
        this.age = age;
        this.time = time;
    }

    public User() {

    }


}
